import logging
import yagmail
def log_set():
    logging.basicConfig(level=logging.DEBUG, format='%(message)s', filename='log.txt')

def sende_mail(file):
    mail=yagmail.SMTP(user='2834326498@qq.com',password='ersutdeapgbedgej',host='smtp.qq.com')
    mail.send(to='2834326498@qq.com',subject='测试报告',contents='请查看',attachments=file)